<template>
  <div>
    <div class="wrap">
      <div class="orderKindsWrap">
        <div class="kindsTitle">
          <img src="@/assets/warning.png" alt="" class="waringImg" />
          <em class="watting">{{resEnterApplyInfo.status==0?'待审批':(resEnterApplyInfo.status==1?'您已成为商家':'审核未通过')}}</em>
        </div>
        <div class="wraimgNotes" v-if="resEnterApplyInfo.status==1">温馨提示：商户相关功能请<em class="loginB" @click="jumpBlogin">登入商户端</em> 进行操作！</div> 
      </div>
      <div class="title" v-if="resEnterApplyInfo.status==2">
        未通过原因
      </div>
      <div class="infoList infoList2 infoList3" v-if="resEnterApplyInfo.status==2">
        {{resEnterApplyInfo.refuseReason}}
      </div>
      
      <div class="title">
        订单信息
      </div>
      <div class="infoList infoList2">
        <div class="lineWrap">
          <div class="leftLine">订单编号</div>
          <div class="rightLine">{{resEnterApplyInfo.orderNum}}</div>
        </div>
        <div class="lineWrap">
          <div class="leftLine">申请时间</div>
          <div class="rightLine">{{resEnterApplyInfo.createTime}}</div>
        </div>
        <div class="lineWrap">
          <div class="leftLine">租赁时间</div>
          <div class="rightLine">{{resEnterApplyInfo.tenancyNum}}个月</div>
        </div>
        <div class="lineWrap">
          <div class="leftLine">付款时间</div>
          <div class="rightLine">{{resEnterApplyInfo.payTime}}</div>
        </div>
        <div class="lineWrap">
          <div class="leftLine">付款金额</div>
          <div class="rightLine">￥{{resEnterApplyInfo.payPrice}}</div>
        </div>
      </div>
      <div class="title">
        基本资料
      </div>
      <div class="infoList infoList2">
        <div class="lineWrap">
          <div class="leftLine">店铺名称</div>
          <div class="rightLine">{{resEnterApplyInfo.shopName}}</div>
        </div>
        <div class="lineWrap">
          <div class="leftLine">店铺类型</div>
          <div class="rightLine">{{resEnterApplyInfo.shopTypeName}}</div>
        </div>
         <div class="lineWrap">
          <div class="leftLine">联系人</div>
          <div class="rightLine">{{resEnterApplyInfo.realName}}</div>
        </div>
         <div class="lineWrap">
          <div class="leftLine">联系电话</div>
          <div class="rightLine">{{resEnterApplyInfo.mobile}}</div>
        </div>
         <div class="lineWrap">
          <div class="leftLine">身份照号码</div>
          <div class="rightLine">{{resEnterApplyInfo.idCard}}</div>
        </div>
         <div class="lineWrap">
          <div class="leftLine">所在校区</div>
          <div class="rightLine">{{resEnterApplyInfo.schoolName}}</div>
        </div>
         <div class="lineWrap">
          <div class="leftLine">学号</div>
          <div class="rightLine">{{resEnterApplyInfo.studentNum}}</div>
        </div>
      </div>
      <div class="reSendApply" @click="reApply()" v-if="resEnterApplyInfo.status==2">再次申请</div>
    </div>
  </div>
</template>

<script>
import { apiEnterApplyDetails } from "@/request/api"; // api接口
export default {
  name: "App",
  data() {
    return {
      resEnterApplyInfo:'',
    };
  },
  mounted() {
    this.getEnterApplyDetails()
    
},
  methods: {
     //查询商户端的信息 判断跳转页面
    getEnterApplyDetails() {
      apiEnterApplyDetails({}).then((res) => {
         console.log("商户资料填写", res);
          this.resEnterApplyInfo = res.data
          // if (!res.data.isFinish) {
          //   console.log("没有完善个人地址信息-跳转信息完善页面");
          //   window.location.href =  `${this.$hostName}/#/pages/reciveAddrList`
          // } else {
          //   console.log("完善了个人信息-跳转首页");
          //   window.location.href = `${this.$hostName}/`; //由于axios全局只加载一次，在登录接口的时候已经加载了第一次，用户的token、userId需要在登录之后才能设置到header里面，需要在程序上重新执行一次axios代码逻辑，这种跳转方式能够实现axios封装重新注册执行一次
          // }
      });
    },
    //被拒再次申请
    reApply(){
     sessionStorage.removeItem('applyInformation')
      this.$router.replace({
          path: "/pages/BecomeBusinessman",
          query: {
            //传递参数
          },
        });
    },
    jumpBlogin(){
      this.$router.push({
          path: "/pages/bLogin",
          query: {
            //传递参数
          },
        });
    }
  },
  created() {},
  components: {},
};
</script>

<style scoped>
.wrap {
  background: #f2f4fa;
  padding: 15px;
  min-height: calc(100vh - 70px);
}
.orderKindsWrap {
  width: calc(100% - 44px);
  background: #ffffff;
  border-radius: 20px;
  padding: 30px 22px;
  margin-bottom: 20px;
}
.wraimgNotes{
 font-size: 14px;
 text-align: center;
 margin-top: 10px;
}
.loginB{
   font-weight: bold;
   color: #f9a31f;
}
.kindsTitle {
  font-size: 16px;
  font-weight: bold;
  color: #f9a31f;
  display: flex;
  justify-content: center;
}
.watting {
  /* padding-bottom: 10px; */
  align-items: center;
  display: inline-block;
  margin-top: 8px;
}
.waringImg {
  width: 45px;
  height: 45px;
}
.explain {
  text-align: center;
  font-size: 12px;
  font-weight: 400;
  color: #666666;
}
.title {
  font-size: 14px;
  font-weight: 400;
  color: #000;
  margin: 20px 0px 16px 0px;
}
.loginIn {
  color: #f48f5b;
}
.infoList {
  overflow: hidden;
  width: calc(100% - 30px);
  background: #ffffff;
  border-radius: 20px;
  padding: 15px 15px 5px 15px;
  margin-bottom: 20px;
}
.left {
  float: left;
}
.infoItem {
  height: 20px;
  line-height: 20px;
  display: flex;
  margin-bottom: 15px;
}
.infoItem img {
  width: 17px;
  height: auto;
  align-items: center;
  padding-right: 15.5px;
}
.infoItem em {
  font-size: 14px;
  font-weight: 400;
  color: #000000;
}
.rightArrow {
  float: right;
  width: 5px;
  height: 9px;
  margin-top: 40px;
}

.infoList2 {
}
.infoList3{
  font-size: 14px;
  line-height: 25px;
  font-weight: 400;
  color: #000000;
  padding-bottom: 15px;
}
.lineWrap {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}
.leftLine {
  font-size: 14px;
  font-weight: 600;
  color: #010101;
}
.rightLine {
  font-size: 14px;
  font-weight: 300;
  color: #010101;
}
.reSendApply{
  width: 95%;
  margin: 0 auto;
  background-color: #010101;
  color: #fff;
  font-size: 14px;
  text-align: center;
  height: 46px;
  line-height: 46px;
  border-radius: 20px;
}
</style>
